import { QuestionaireAnswerInfoQo } from '@/services/quest';
import { ExamItem, Questionaire } from '@/store/design/types';
import AnswerInforAdapter from './AnswerInforAdapter';
import AnswerlistAdapter from './AnswerlistAdapter';

export default class AnswerAdapter {
  parse(
    value: Questionaire,
    content: ExamItem[],
    userId: string,
  ): QuestionaireAnswerInfoQo {
    const vo: QuestionaireAnswerInfoQo = {
      answerInfo: new AnswerInforAdapter().parse(value, userId),
      details: new AnswerlistAdapter().parse(content),
    };

    return vo;
  }
}
